import React, { Component } from 'react'
// 导入静态图片
import img1 from '../../../assets/images/nav-1.png'
import img2 from '../../../assets/images/nav-2.png'
import img3 from '../../../assets/images/nav-3.png'
import img4 from '../../../assets/images/nav-4.png'
import styles from '../ss.module.scss'
import { Flex } from 'antd-mobile';
const entryData = [
  {
     id:1,
     imgSrc:img1,
     tetx:'整租',
     path: '/home/list'
  },
  {
     id:2,
     imgSrc:img2,
     tetx:'合租',
     path: '/home/list'
  },
  {
     id:3,
     imgSrc:img3,
     tetx:'地图找房',
     path:'/mapFound'
  },
  {
     id:4,
     imgSrc:img4,
     tetx:'去出租',
     path: '/rent/add'
  },
]
export default class navImg extends Component {
   constructor(props){
    super(props)
    console.log('====================================');
    console.log('mmmm',props);
    console.log('====================================');
   }
    renderNavs(){
      return entryData.map(item => (
          // <a href="#" key={item.id} >
          //     <img  className={styles.entry_img} src={item.imgSrc} alt=""  />
          //     <span className={styles.entry_text}>{item.tetx}</span>
          // </a>
          <Flex.Item
          key={item.id}
          onClick={() => this.props.history.push(item.path)}
        >

          <img src={item.imgSrc} alt="" />
          <h2 >{item.tetx}</h2>
        </Flex.Item>
      ))
    }
  render() {
    return (
      <div>
         <Flex className={styles.nav}>
            {this.renderNavs()}
          </Flex> 
      </div>
    )
  }
}
